package chixing.day07_inherited.HomeWork;

public class SalesEmployee extends MyEmployee{
    private double salesAmount;
    private double commissionRate;
    public void calculateSalary(){
        double othersalary = salesAmount*commissionRate;
        System.out.println("总工资="+getEmpBaseSalary()+othersalary);
    }

    public SalesEmployee(double salesAmount, double commissionRate) {
        this.salesAmount = salesAmount;
        this.commissionRate = commissionRate;
    }

    public SalesEmployee(String empNo, String empName, double empBaseSalary, double salesAmount, double commissionRate) {
        super(empNo, empName, empBaseSalary);
        this.salesAmount = salesAmount;
        this.commissionRate = commissionRate;
    }

    public double getSalesAmount() {
        return salesAmount;
    }

    public void setSalesAmount(double salesAmount) {
        this.salesAmount = salesAmount;
    }

    public double getCommissionRate() {
        return commissionRate;
    }

    public void setCommissionRate(double commissionRate) {
        this.commissionRate = commissionRate;
    }

    @Override
    public String toString() {
        return "SalesEmployee{" +
                "salesAmount=" + salesAmount +
                ", commissionRate=" + commissionRate +
                "} " + super.toString();
    }
}

